package com.mushuilingfeng.ddd.user.domain.org.service.impl;

import com.mushuilingfeng.ddd.user.domain.base.service.StorageAtomicIntegerService;
import com.mushuilingfeng.ddd.user.domain.org.service.IOrgService;
import com.mushuilingfeng.ddd.framework.AsSpringBean;
import com.mushuilingfeng.ddd.framework.factory.DomainServiceFactory;

/**
 * @author
 * @date 2024/9/24
 */
@AsSpringBean
public class OrgService implements IOrgService {
    private static final String ORG_CODE_PREFIX = "ORG#";

    @Override
    public String newOrgCode() {
        return ORG_CODE_PREFIX + DomainServiceFactory.getDomainService(StorageAtomicIntegerService.class).getAndIncrement("OrgService");
    }
}
